-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding hx-headers-* server-side processing to hx-headers #36
Conversation
Yes, typically the unit tests go under My only concern with this approach is it could break existing HTMX implementations. If there already is an |
Keep in mind. We probably want to avoid hi-jacking or colliding with any of the htmx attributes. So while I like the What are your thoughts? |
Yes, I agree! I was going to suggest removing So to clarify, if there's already value in |
I made some changes:
Please review at your convenience. |
I was curious about keys that are commonly used, and it seems like this approach should be OK. I was concerned that folks might want a key without dashes, but that doesn't seem to be something outside the convention. https://en.wikipedia.org/wiki/List_of_HTTP_header_fields Would you mind trying out some of the longer keys and see what that would look like? (Your code looks like it would handle it fine but might be worth adding to the sample). |
Randomly picked a few standard and non standard Header Fields:
|
Thanks, this looks great. I'll try to get a new version of this released. |
Woot! Thanks 👍 |
Hi @khalidabuhakmeh ,
I'm suggesting the addition of
hx-headers-*
support to Htmx.Net, which will enable developers to set custom HTTP headers for htmx requests. This enhancement aligns with the documentation https://htmx.org/attributes/hx-headers.With this feature, you can now define headers like this:
or
This could also be useful to add
RequestVerificationToken
I want to add unit tests but I don't see Htmx.TagHelper.Tests project. Should the unit tests go under Htmx.Tests project?
I'm excited to hear your feedback on this proposal and whether it aligns with the project's objectives. Thank you for considering this improvement. I also have Sample code in the Sample project. Please take a look and let me now what you think.